<template>
  <view class="container">
    <uni-list>
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="用户名" :rightText="username" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="tel" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="职位" :rightText="appointment" />
	  <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="所属组别" :rightText="groups" />
    </uni-list>
  </view>
</template>

<script>
  import { getUserProfile } from "@/api/system/user"

  export default {
    data() {
      return {
        username: '',
        groups: '',
        appointment: '',
        tel: '',
      }
    },
    onLoad() {
      this.username = uni.getStorageSync('username');
	  this.appointment = uni.getStorageSync('appointment');
	  this.groups = uni.getStorageSync('groups');
	  this.tel = uni.getStorageSync('tel');
    },
    methods: {
      getUser() {
        getUserProfile().then(response => {
          this.user = response.data
        })
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>
